import request from '@/utils/request'


// 查询邮件列表
export function listEmail(query) {
  return request({
    url: '/system/email/list',
    method: 'get',
    params: query
  })
}

// 查询邮件详细
export function getEmail(configId) {
  return request({
    url: '/system/email/' + configId,
    method: 'get'
  })
}

// 发送邮件
export function sendEmail(data) {
  return request({
    url: '/system/email/send',
    method: 'post',
    data: data
  })
}

// 存草稿
export function saveEmail(data) {
  return request({
    url: '/system/email/save',
    method: 'post',
    data: data
  })
}





// 查询参数列表
export function listConfig(query) {
  return request({
    url: '/system/config/list',
    method: 'get',
    params: query
  })
}



// 根据参数键名查询参数值
export function getConfigKey(configKey) {
  return request({
    url: '/system/config/configKey/' + configKey,
    method: 'get'
  })
}



// 修改参数配置
export function updateEmail(data) {
  return request({
    url: '/system/email/update',
    method: 'post',
    data: data
  })
}

// 删除参数配置
export function delConfig(configId) {
  return request({
    url: '/system/config/' + configId,
    method: 'delete'
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/system/config/refreshCache',
    method: 'delete'
  })
}

// 获取邮件统计信息
export function getMailStat(){
  return request({
    url: '/system/email/data',
    method: 'get'
  })
}

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/system/email/user',
    method: 'get',
    params: query
  })
}

// 删除
export function deleMail(data){
  return request({
    url: `/system/email/remove/${data.id}`,
    method: 'get'
  })
}

// 通讯录
export function getContList(query){
  return request({
    url: `/system/user/list`,
    method: 'get',
    params: query
  })
}

// 聊天列表
export function getChat(query){
  return request({
    url: `/system/msg/list`,
    method: 'get',
    params: query
  })
}

// 创建聊天
export function createChat(query){
  return request({
    url: `/system/msg/add`,
    method: 'get',
    params: query
  })
}

// 聊天记录
export function getChatHistory(query){
  return request({
    url: `/system/msg/read`,
    method: 'get',
    params: query
  })
}

// 首页信息
export function getIndexInfo(query){
  return request({
    url: `/system/home/page`,
    method: 'get',
    params: query
  })
}

// 汇总
export function getIndexList(query){
  return request({
    url: `/bus/duty/page`,
    method: 'get',
    params: query
  })
}




